package com.example.administrator.yuejian35.Club.model;

import com.example.administrator.yuejian35.Club.interf.ClubService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.example.administrator.yuejian35.Config.BASE_URL;


/**
 * Created by HP on 2017/9/26.
 */

public class ClubModel {
    private Retrofit retrofit;
    public ClubModel(){
        retrofit = new Retrofit.Builder()
                .baseUrl(BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call getallclubs(){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getallclubs();
    }


    public Call getclubphoto(String clubid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getclubphoto(clubid);
    }

    public Call getclub(String clubid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getclub(clubid);
    }

    public Call getcoursebyclub(String clubid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getcoursebyclub(clubid);
    }

    public Call guanzhuclub(String clubid, String uid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.guanzhuclub(clubid,uid);
    }




    public Call getvideobyclub(String clubid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getvideobyclub(clubid);
    }

    public Call getAllCoach(String clubid){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.getAllCoach(clubid);
    }

    public Call searchclub(String clubname){
        ClubService clubService = retrofit.create(ClubService.class);
        return clubService.searchclub(clubname);
    }
}
